package SV_TMPFILE;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;

public class Vunerable_02 {
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException,  IOException {
        String name = req.getParameter("USERNAME");
        File file = File.createTempFile(name, ".tmp");
        dumpSensitiveInfoAndRunSomeApp(file);
        file.delete();
    }

    private void dumpSensitiveInfoAndRunSomeApp(File file) {
        // ...
    }
}
